//
//  EGHomeAdCell.m
//  Orchard
//
//  Created by 黄勇锋 on 16/8/18.
//  Copyright © 2016年 itcast. All rights reserved.
//

#import "EGHomeAdCell.h"


@interface EGHomeAdCell()

@property (strong,nonatomic) UIImageView *adImageView;


@end


@implementation EGHomeAdCell


- (void)layoutSubviews{

    [self setupUI];
    
}

- (void)setupUI{
    
    //添加控件,
    [self.contentView addSubview:self.adImageView];

    //设置约束
    [self.adImageView makeConstraints:^(MASConstraintMaker *make) {
        
        make.edges.equalTo(UIEdgeInsetsZero);
    }];
    
}


- (void)setModel:(EGHomeModel *)model{
    
    _model = model;
    
    [self.adImageView sd_setImageWithURL:[NSURL URLWithString:model.img]];
    
}


- (UIImageView *)adImageView{
    
    if (_adImageView == nil) {
        
        _adImageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"shopCart_r"]];
    }
    
    return _adImageView;
}






@end
